package com.mvc.business.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.mvc.ProjectUtils;
import com.mvc.base.model.BaseCompany;
import com.mvc.base.model.Supplier;

/**
 * 
 * @author snowpbx
 * @version V1.0 Create Time: 2012-10-25
 */
@Entity(name = "B_SCHEDULE")
public class Schedule extends BaseCompany {
	@NotNull
	private Integer	 purchaseId;
	@NotNull
	private Integer	 purchaseItemId;
	@NotNull
	@Length(max = 32)
	private String	 customerPurchaseNo;
	@NotNull
	private Integer	 supplierId;

	@Length(max = 64)
	private String	 name;
	@Length(max = 128)
	private String	 englishName;
	@NotNull
	private Double	 quantity;
	@NotNull
	private Integer	 unit;
	@Length(max = 64)
	private String	 version;

	private Date	 fileDate;

	private Date	 bluePaperDate;

	private Date	 confirmProduceDate;

	private Date	 sampleDate;

	private Date	 confirmSampleDate;
	// 箱唛
	private Date	 boxMarkDate;

	@Length(max = 32)
	private String	 piNo;
	// 截仓时间
	private Date	 closeDate;
	// 走货时间
	private Date	 sendDate;
	@Length(max = 64)
	private String	 progress;
	@Length(max = 128)
	private String	 remark;
	@NotNull
	private Boolean	 finished;
	@NotNull
	private Date	 generateDate;
	@Transient
	private Supplier	supplier;

	public Integer getPurchaseId() {
		return purchaseId;
	}

	public void setPurchaseId(Integer purchaseId) {
		this.purchaseId = purchaseId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEnglishName() {
		return englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	public Double getQuantity() {
		return quantity;
	}

	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}

	public Date getSampleDate() {
		return sampleDate;
	}

	public void setSampleDate(Date sampleDate) {
		this.sampleDate = sampleDate;
	}

	public Date getSendDate() {
		return sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Integer supplierId) {
		this.supplierId = supplierId;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public Date getFileDate() {
		return fileDate;
	}

	public void setFileDate(Date fileDate) {
		this.fileDate = fileDate;
	}

	public Date getBluePaperDate() {
		return bluePaperDate;
	}

	public void setBluePaperDate(Date bluePaperDate) {
		this.bluePaperDate = bluePaperDate;
	}

	public Date getConfirmProduceDate() {
		return confirmProduceDate;
	}

	public void setConfirmProduceDate(Date confirmProduceDate) {
		this.confirmProduceDate = confirmProduceDate;
	}

	public Date getConfirmSampleDate() {
		return confirmSampleDate;
	}

	public void setConfirmSampleDate(Date confirmSampleDate) {
		this.confirmSampleDate = confirmSampleDate;
	}

	public Date getBoxMarkDate() {
		return boxMarkDate;
	}

	public void setBoxMarkDate(Date boxMarkDate) {
		this.boxMarkDate = boxMarkDate;
	}

	public String getPiNo() {
		return piNo;
	}

	public void setPiNo(String piNo) {
		this.piNo = piNo;
	}

	public Date getCloseDate() {
		return closeDate;
	}

	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}

	public String getProgress() {
		return progress;
	}

	public void setProgress(String progress) {
		this.progress = progress;
	}

	public Boolean getFinished() {
		return finished;
	}

	public void setFinished(Boolean finished) {
		this.finished = finished;
	}

	public String getPurchaseNo() {
		return ProjectUtils.getPurchaseNo(purchaseId);
	}

	public String getSupplierNo() {
		return ProjectUtils.getSupplierNo(supplierId);
	}

	public Integer getPurchaseItemId() {
		return purchaseItemId;
	}

	public String getCustomerPurchaseNo() {
		return customerPurchaseNo;
	}

	public void setCustomerPurchaseNo(String customerPurchaseNo) {
		this.customerPurchaseNo = customerPurchaseNo;
	}

	public void setPurchaseItemId(Integer purchaseItemId) {
		this.purchaseItemId = purchaseItemId;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Date getGenerateDate() {
		return generateDate;
	}

	public void setGenerateDate(Date generateDate) {
		this.generateDate = generateDate;
	}

	public Integer getUnit() {
		return unit;
	}

	public void setUnit(Integer unit) {
		this.unit = unit;
	}

}
